package net.example.model;

import com.oraycn.omcs.utils.SerializeUtils;

import net.example.utils.SerializeHelper;

import java.util.Date;

import io.netty.buffer.ByteBuf;

public class AddFriendRequest {

    public Integer AutoID;

    public String RequesterID;

    public String AccepterID;

    public String RequesterCatalogName;

    public String AccepterCatalogName;

    public String Comment;

    /// <summary>
    /// State 0:请求中 1：同意  2：拒绝
    /// </summary>
    public Integer State;

    /// <summary>
    /// Notified 0:申请未通知对方  1：申请已通知对方
    /// </summary>
    public Boolean Notified;

    public Date CreateTime;


    public void deSerialize(byte[] info) throws Exception {
        ByteBuf buffer = SerializeHelper.wrappedBuffer(info);
        deSerialize(buffer);
    }

    public void deSerialize(ByteBuf buffer)throws Exception
    {
        buffer.readInt();
        this.AccepterCatalogName = SerializeUtils.readStrIntLen(buffer);
        this.AccepterID = SerializeUtils.readStrIntLen(buffer);
        this.AutoID = buffer.readInt();
        this.Comment = SerializeUtils.readStrIntLen(buffer);
        this.CreateTime = new Date(buffer.readLong());
        this.Notified = buffer.readBoolean();
        this.RequesterCatalogName = SerializeUtils.readStrIntLen(buffer);
        this.RequesterID = SerializeUtils.readStrIntLen(buffer);
        this.State = buffer.readInt();
    }

}

